package me.zhengjie.modules.weixin.message.reply;


import me.zhengjie.modules.weixin.enums.WeChatMsgTypeEnum;
import org.apache.commons.lang3.StringUtils;

/**
 * 被动回复音频消息
 *
 */
public class ReplyVoiceMessage extends AbstractReplyMessage {

    public ReplyVoiceMessage() {
        super();
        setMsgType(WeChatMsgTypeEnum.voice.name());
    }

    public ReplyVoiceMessage(String mediaId) {
        this();
        VoiceMessage voice = new VoiceMessage();
        voice.MediaId = mediaId;
        this.Voice = voice;
    }

    private VoiceMessage Voice;

    public VoiceMessage getVoice() {
        return Voice;
    }

    public void setVoice(VoiceMessage voice) {
        Voice = voice;
    }

    public static class VoiceMessage {

        private String MediaId;

        public String getMediaId() {
            return MediaId;
        }

        public void setMediaId(String mediaId) {
            MediaId = mediaId;
        }
    }

    @Override
    public boolean isValidReply() {
        return null != Voice && StringUtils.isNotBlank(Voice.MediaId);
    }
}
